<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="../assets/js/vue.js"></script>
    <title>Component 初识组件</title>
</head>

<body>
    <h1>Component 初识组件</h1>
    <hr>
    <div id="app">
        <jslink></jslink>
        <panda></panda>
    </div>
    <script type="text/javascript">
        Vue.component('jslink',{
            template:`<div style="color:red">全局化注册的jslink组件</div>`   //全局注册的组件也要挂载在app下
        })
        var app = new Vue({
            el: '#app',
            components:{
                "panda":{
                    template:`<div style="color:#00925f">局部注册的jslink组件</div>`
                }
            }
        })
    </script>
</body>

</html>